/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sourcery;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
 *
 * @author claire
 */
public class KeyboardHandler implements KeyListener {
    MainPanel panel;

    public KeyboardHandler(MainPanel panel) {
        this.panel = panel;
    }
    
    public void keyTyped(KeyEvent e) {
    }

    public void keyPressed(KeyEvent e) {
        switch(e.getKeyChar()) {
            case 'n':
                panel.newNodeAtMouse();
                break;
            case 'c':
                panel.doConnector();
                break;
            default:
        }
    }

    public void keyReleased(KeyEvent e) {
    }

}
